Skip to content

feat: OCI image loader (Hyper.Img.OciLoader)#24

Merged
markovejnovic merged 27 commits into
mainfrom
feat/oci-loader
Jun 25, 2026
Merged

feat: OCI image loader (Hyper.Img.OciLoader)#24
markovejnovic merged 27 commits into
mainfrom
feat/oci-loader

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.95868% with 115 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/hyper/img/oci_loader.ex 10.16% 53 Missing ⚠️
lib/hyper/img.ex 0.00% 32 Missing ⚠️
lib/hyper/img/oci_loader/umoci.ex 0.00% 14 Missing ⚠️
lib/hyper/grpc/codec.ex 0.00% 7 Missing ⚠️
lib/hyper/config.ex 0.00% 4 Missing ⚠️
lib/hyper/grpc/server.ex 0.00% 4 Missing ⚠️
lib/hyper/node.ex 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Test Results

212 tests  +54   211 ✅ +53   4s ⏱️ +3s
 43 suites +13     1 💤 + 1 
  2 files   ± 0     0 ❌ ± 0 

Results for commit 8d068b5. ± Comparison against base commit e81fa81.

♻️ This comment has been updated with latest results.

…zer)

- format two test files (codec_test, oci_loader_test)
- credo --strict: drop redundant with-clause result; cond -> if in publish_file
- sha256_file: File.stream!/3 arg order was wrong (modes/bytes swapped) -- a real
  hashing bug; switch to the shared Hyper.Redist.Sha256.file/1 helper
- dialyzer: silence the Ecto.Multi opacity false positive in record/3
- drop Umoci.test_system/0; node boot just calls ensure_installed (a bad
  operator-set path is caught at load time via OciLoader.test_system)
- flatten umoci asset/url/sha256 into a single @downloads map (firecracker shape);
  drop asset_for/1, asset_url/1
- delete codec_test.exs and umoci_test.exs; trim OciLoader source/1 + goarch/1
  tests -- validation/mapping the type system already constrains
Promote Hyper.Img to a real module: create/2 takes a prepared image file path,
content-addresses it, publishes it into the media store, and records the base
image (blobs + images + image_layers). OciLoader now only converts an OCI ref to
an ext4 rootfs and hands the path to Hyper.Img.create/2 -- the store/DB concern
no longer lives inline in the loader.
@decorate with_span on create/2 (parent), content_id (sha256), and publish
(file move); the record DB work is already traced by OpentelemetryEcto.
- OciLoader.load: info on start + success, warning on failure
- debug logs at the slow stages (pull/flatten, ext4 build)
- Umoci: info when it downloads the default binary
ext4_size/dir_size/build_ext4 now speak Unit.Information instead of raw byte
ints + @mib/@base_overhead_bytes/@floor_bytes constants.
1. umoci unpack now passes --rootless (plain unpack chown/mknod fails EPERM on
   the unprivileged BEAM, breaking every non-trivial image)
2. place/2 removes the partial destination if a cross-fs copy fails (else the
   next load reuses a truncated rootfs)
3. ext4 sizing now uses block-aware du -sB1, sizes in the inode table, and
   passes mke2fs -N <file-count + headroom> so inode-dense images don't fail
4. test_system/0 guards Sys.Arch.current up front so an unsupported arch returns
   an error tuple instead of raising MatchError through Umoci.bin/0
5. create/2 rolls back a newly-published store file when record/3 fails (a
   reused/pre-existing file is left alone)
@markovejnovic markovejnovic merged commit 2180119 into main Jun 25, 2026
6 checks passed
@markovejnovic markovejnovic deleted the feat/oci-loader branch June 25, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant